<?php

namespace App\Services;

use App\Interfaces\AuthInterface;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\RpcServer\Annotation\RpcService;

/**
 * @RpcService(name="UserAuthService", protocol="jsonrpc-http", server="jsonrpc-http", publishTo="consul")
 */
class UserAuthService implements AuthInterface
{

    public function register(array $params)
    {
        // TODO: Implement register() method.

        return [
            "error" => 1 ,
            "message" => '注册成功！',
            "result"=>[
                "user_id"=>rand(1,9999999999),
            ]
        ];
    }

    public function login(array $params)
    {
        var_dump($params);
        // TODO: Implement login() method.
        return [
            "error" => 1 ,
            "message" => '登录成功！',
            "result"=>[
                "token"=>uniqid(),
            ]
        ];
    }
}